package com.yuju.group.enums;

/**
 * 类名：OwnerCustomReturnCodeEnum  <br />
 *
 * 功能：
 *
 * @author : jiaokn <br />
 * @Date : 2017年11月24日 下午4:37:00  <br />
 * @version : 1.1 <br />
 */
public enum OwnerCustomReturnCodeEnum {
	
	OWNERCUSTOM_SAVE_SUCCESS("yuju-ownerCustom-1001", "业主信息新增成功"),
	OWNERCUSTOM_SAVE_FAILURE("yuju-ownerCustom-1002", "业主信息新增失败"),
	OWNERCUSTOM_DEL_SUCCESS("yuju-ownerCustom-1003", "业主信息删除成功"),
	OWNERCUSTOM_DEL_FAILURE("yuju-ownerCustom-1004", "业主信息删除失败"),
	OWNERCUSTOM_UPDATE_SUCCESS("yuju-ownerCustom-1005", "业主信息更新成功"),
	OWNERCUSTOM_UPDATE_FAILURE("yuju-ownerCustom-1006", "业主信息更新失败"),
	OWNERCUSTOM_QUERY_SUCCESS("yuju-ownerCustom-1007", "业主信息查找成功"),
	OWNERCUSTOM_QUERY_FAILURE("yuju-ownerCustom-1008", "业主信息查找失败");
	
	
	private String code;
	private String desc;
	
	OwnerCustomReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (GroupReturnCodeEnum enume : GroupReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
